package com.download.net;


public class DTask {
	final int TYPE_AUTO = 0x1001;
	final int PRIORITY_HIGH = 0x2001;
	final int PRIORITY_NORMAL = 0x2002;
	final int PRIORITY_LOW = 0x2003;
	static int nextTaskId = 0;
	
	private int taskId;
	public int type = TYPE_AUTO;
	public int priority = PRIORITY_NORMAL; 
	public String url;
	public DCallback callback;
	
	DTask(String url, DCallback callback){
		taskId = nextTaskId++;
		this.url = url;
		this.callback = callback;
	}
	
	int taskid(){
		return taskId;
	}
	
	int type(){
		return type;
	}
	
	void setType(int type){
		this.type = type;
	}
	
	int priority(){
		return priority;
	}
	
	void setPriority(int priority){
		this.priority = priority;		
	}
	
	// 拷贝构造里面需要考虑创建新的taskId
}
